home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Help / Alpha Commands < prev    next >
Encoding:
Text File  |  2000-12-15  |  37.6 KB  |  770 lines

  1. ==============================================================================
  2. = Alpha Commands
  3. ==============================================================================
  4.  
  5. In this list of routines, text between '<' and '>' is a placeholder for a 
  6. required parameter, text between '[' and ']' is a placeholder for an 
  7. optional parameter, and the '|' signifies a choice of two or more 
  8. alternatives.  A '+' signifies that the previous symbol can be present one 
  9. or more times, while a '*" means zero or more times.  Some commands have no 
  10. parameters, and are only expected to be called interactively.
  11.  
  12. The following are Alpha-specific tcl routines:
  13.  
  14. Window related commands:
  15.  
  16.  Basic insertion position queries
  17.  
  18. • getPos [-w <win>] - return the current insertion point
  19. • lineStart <pos> - return the position of the start of
  20.   the line 'pos' is on.
  21. • matchIt <brace char> <pos> [<limit>] - Return pos of matching brace. Recognizes 
  22.   parenthesis, square brackets, and curly braces. Optional third argument 
  23.   specifies how many characters to search.
  24. • minPos - returns the first position in the current window.  This will
  25.   normally be '0' in Alpha 7.x, but for compatibility with Alphatk (in
  26.   which it is 1.0) should not be so assumed.
  27. • maxPos [-w <win>] - returns the position of the last character in the front
  28.   window.
  29. • nextLineStart <pos> - return the position of the start 
  30.   of the next line after position 'pos'.
  31. • pos::diff <pos1> <pos2> returns the number of characters between the
  32.   two positions in the current window.
  33. • pos::math <pos> ?+/- offset? ...  returns that position which is
  34.   given by moving the given number of characters backwards or forwards
  35.   in the current window.  Any number of offset arguments may be given,
  36.   with or without spaces separating the arguments.  For future compatibility
  37.   pos::math should be used in preference to numerical addition: positions
  38.   cannot be assumed to be simple integers.
  39. • pos::compare <pos1> <comparison> <pos2> returns 1 or 0 depending on
  40.   whether the given comparison is true or not.  Valid comparisons are
  41.   ==, !=, <, >, <=, >= etc.  For future compatibility, pos::compare
  42.   should be used in preference to a direct, numerical comparison.
  43. • posToRowCol <pos> - converts from absolute position to row, col.
  44. • rowColToPos [-w <win>] <row> <col> - converts to abosolute position.
  45.   Accepts optional -w parameter that allows window to be specified.
  46.  
  47.  Basic insertion position movement
  48.  
  49. • backwardChar - moves insertion one char back
  50. • backwardWord - moves insertion one word back
  51. • beginningOfBuffer - move insertion to the beginning 
  52.   of the buffer
  53. • beginningOfLine - move insertion to the beginning of 
  54.   the line
  55. • endOfBuffer - move insertion to the end of the buffer
  56. • endOfLine - move insertion to the end of the line
  57. • exchangePointAndMark - exchange the current 'mark' 
  58.   w/ the current insertion point
  59. • forwardChar - move insertion one character forward
  60. • forwardWord - move insertion one word forward
  61. • goto <pos> - goto the position 'pos'.
  62. • gotoMark - goto named mark, use 'mark' in macros.
  63. • gotoTMark <name> - goto the temporary mark 'name'.
  64. • matchBrace - moves the insertion point to the 
  65.   character that matches the character after the current 
  66.   insertion point
  67. • nextLine - move insertion point to next line
  68. • nextSentence - go to next sentence ("textFill.tcl").
  69. • previousLine - move insertion point to the previous 
  70.   line
  71. • prevSentence - go to previous sentence ("textFill.tcl").
  72.  
  73.  Basic text manipulation
  74.  
  75. • deleteText <pos1> <pos2> - remove text between 'pos1' 
  76.   and 'pos2'
  77. • getText [-w <win>] <pos1> <pos2> - return the text between 'pos1' 
  78.   and 'pos2'. '-w' can be used to specify a window.
  79. • insertText [-w <win name>] <text>* - Insert 'text' at the current 
  80.   insertion point. Mark is unchanged.
  81. • lookAt [-w <name>] <pos> - return the 'pos'th character of the 
  82.   current file, or the file named by <name> if the '-w' option is specified.
  83. • replaceText ?-w win? <pos1> <pos2> [text]+ - replaces the text
  84.   between 'pos1' and 'pos2' with 'text', where 'text' can be any number 
  85.   of arguments. Leaves insertion at end, mark at beginning of inserted 
  86.   text. 
  87.  
  88.    Selection manipulation and creation
  89.  
  90. • balance - selects smallest set of parens, braces, or 
  91.   brackets that encloses the current selection
  92. • backwardCharSelect - extends selection one char back
  93. • beginningBufferSelect - extend selection to the 
  94.   beginning of the buffer
  95. • beginningLineSelect - extend selection to the 
  96.   beginning of the line
  97. • clear - clear selected text
  98. • deleteSelection - delete current position, don't save
  99. • endBufferSelect - extend selection to the end of the 
  100.   buffer
  101. • endLineSelect - extend selection to the end of line
  102. • forwardCharSelect - extend selection one character 
  103.   forward
  104. • getSelect - return the currently selected text, if 
  105.   any.
  106. • markHilite - This is the 'Hilite' from the 'Edit'
  107.   menu. If there is a currently hilited selection, the 
  108.   selection is unhilited, leaving the mark and the 
  109.   insertion point around the old selection. If there 
  110.   is not a selection, the region between the insertion 
  111.   point and the mark is selected.
  112. • nextLineSelect - extend selection to the next line
  113. • prevLineSelect - extend selection to the previous line
  114. • rectMarkHilite - creates a rectangular selection 
  115.   between the mark and the insertion point.
  116. • select [-w <win>] <pos1> <pos2> - selects the text between 'pos1' 
  117.   and 'pos2'.
  118. • selEnd [-w <win>] - returns the end of the hilited selection, or 
  119.   the current insertion point if no text is selected.
  120. • setMark - set the current mark to the insertion point
  121.  
  122.  Clipboard/scrap handling
  123.   
  124. • copy - copy region
  125. • cut - deletes and saves region
  126. • getScrap - returns system TEXT scrap.
  127. • paste - insert the last chunk of text created by 'cut' 
  128.   or 'copy'
  129. • putScrap [<string>]+ - Concatenate strings together into the system 
  130.   scrap. The scrap can be appended to through calls of the form 'putScrap 
  131.   [getScrap] " another word"'.
  132.  
  133.  Various textual manipulations
  134.  
  135. • backSpace - delete selection, or a single char if no selection.
  136. • backwardDeleteWord - deletes previous word
  137. • capitalizeRegion - capitalize first word in selected region 
  138. • capitalizeWord - capitalize word and move to its end
  139. • deleteChar - delete char AFTER cursor
  140. • deleteWord - delete word after cursor
  141. • downcaseRegion - changes all uppercase letters to 
  142.   lowercase in current region
  143. • downcaseWord - changes all uppercase letters to 
  144.   lowercase in current word
  145. • killLine - kill text from insertion point to the end 
  146.   of the line. If the line has no text, delete the line 
  147.   and move succeeding lines up one.
  148. • oneSpace - converts whitespace surrounding insertion
  149.   into a single space.
  150. • openLine - insert a new line following the current 
  151.   one and move the insertion point to it
  152. • spacesToTabs - convert spaces in selection to tabs
  153. • tabsToSpaces - convert tabs in selection to spaces.
  154. • upcaseRegion - convert all lowercase letters to 
  155.   uppercase in the current region
  156. • upcaseWord - convert all lowercase letters to 
  157.   uppercase in the current word
  158. • wrap - see the section on "Fill" routines.
  159. • wrapText
  160.  
  161.  View/insertion interaction
  162.  
  163. • centerRedraw - redraw window with current line in 
  164.   the middle.
  165. • display [-w <win>] <pos> - move pos's line to top of screen.
  166. • insertToTop - make the line that the insertion point 
  167.   is on the first line shown, and display the current 
  168.   line number along w/ the total number of lines in file
  169. • moveInsertionHere [-last] - move the insertion point to the 
  170.   first (or last) line displayed
  171. • pageBack - display prev screenful, move the
  172.   insertion point if 'moveInsertion' enabled
  173. • pageForward - display next screenful, move the
  174.   insertion point if 'moveInsertion' enabled
  175. • scrollDownLine - same action as that which occurs when 
  176.   the down arrow in the vertical scrollbar is selected
  177. • scrollLeftCol - same action as that which occurs when
  178.   the left arrow in the horizontal scrollbar is selected
  179. • scrollRightCol - same action as that which occurs when
  180.   the right arrow in the horizontal scrollbar is 
  181.   selected
  182. • scrollUpLine - same action as that which occurs when 
  183.   the up arrow in the vertical scrollbar is selected
  184.  
  185.  Dialogs for querying the user.
  186.  
  187. • alertnote message_string
  188.   This command will display message_string in a standard Macintosh alert box.
  189. • askyesno [-c] prompt
  190.   This command will display a Macintosh alert box with 'prompt' displayed
  191.   with the push buttons Yes and No. The command will return the 
  192.   string "yes" or "no". The '-c' flag specifies that a cancel button be 
  193.   used as well.
  194. • buttonAlert <prompt> [<button>…] - Create a dialog w/ the specified 
  195.   buttons, returning the one selected.
  196. • colorTriple [<prompt>] [<red> <green> <blue>] - Prompts user to choose 
  197.   color. If specified, the input RGB value is used as the initial color on 
  198.   the colorpicker.
  199. • dialog [<-w width>|<-h height>|<-b title l t r b>|<-c title val l t r b>|
  200.             <-t text l t r b>|<-e text l t r b>|<-r text val l t r b>|
  201.             <-p l t r b>]+ 
  202.   Create and display a dialog.  '-w' and '-h' allow width and height of 
  203.   dialog window to be set.  '-b', '-c', '-r', '-t', '-e' and '-p' allow 
  204.   buttons, checkboxes, radio buttons, static text, editable text and gray 
  205.   outlines to be created, respectively.  All control types (except gray 
  206.   outlines) require specification of a title or text, together with left, 
  207.   top, right, and bottom coordinates.  Checkboxes and radioboxes have an 
  208.   additional parameter, the default value.  At least one button must be 
  209.   specified.  The return value is a list containing resulting values for 
  210.   all buttons, radioboxes, checkboxes, and editable textboxes (static text 
  211.   is ignored).  Buttons have value '1' if chosen, '0' otherwise.  The 
  212.   dialog box exits at the first button press.
  213. • findFile [<path>] - open a file in a new window. An optional path parameter
  214.   specifies a default directory or file.
  215. • get_directory [-p <prompt>]
  216.   This command will display a standard Macintosh file dialog and request the user 
  217.   select a folder. The command will return the selected folder's full path name, or an 
  218.   error if the Cancel button was selected.
  219. • getfile [<prompt>] [<path>]
  220.   This command will display an SFGetFile() and return the full path name of the 
  221.   selected file, or an error if CANCEL button was selected.  An optional path 
  222.   parameter specifies a default directory or file.
  223. • getline <prompt> <default>
  224.   This command will display a Macintosh alert box with prompt displayed, a 
  225.   text edit field with default initially in the field, and with the push 
  226.   buttons OK, Cancel.. The command will return the text entered into the 
  227.   text edit field by the user, or an empty string if the user selected the 
  228.   Cancel button. 
  229. • listpick [-p <prompt>] [-l] [-L <def list>] <list>
  230.   This command will display a dialog with the list displayed in a List Manager 
  231.   list. If the user presses the Cancel button, an empty string is returned. If 
  232.   the user selects the Open button, or double clicks an item in the list, that 
  233.   item will be returned. If '-l' is specified, than the return is a list of 
  234.   items.
  235. • prompt <prompt> <default> [<name> <menu item>*] - prompt dialog to 
  236.   the user with a prompt string and a default value. The prompt dialog can 
  237.   optionally include a popup menu specified by 'name' and the succeeding 
  238.   strings. Selection of the popup menu items inserts the item text into the 
  239.   editable dialog item. 'Prompt' returns the value of the editable item. 
  240.   If the 'Cancel' button is selected, the tcl returns an error and your 
  241.   script will be stopped unless you execute the command from 'catch'.
  242. • putfile <prompt> <original>
  243.   This command will display an SFPutFile() and return the full path name of the 
  244.   selected file, or an empty string if CANCEL button was selected. Original is the 
  245.   default name displayed for the user.
  246. • setFontsTabs - bring up font and tab dialog
  247.  
  248.  Search, Replace
  249.  
  250. • enterReplaceString - use current selection, if any, for future 
  251.   replacements (in search dialog).
  252. • enterSearchString - use current selection, if any, for future searches.
  253. • find - bring up the find dialog
  254. • findAgain - repeat search forward
  255. • findAgainBackward - repeat search backward
  256. • findInNextFile - search next file.
  257. • performSearch  [options…] <pattern> <pos> - as for 'search' but also
  258.   selects the range of characters which are found, and ensures Alpha's
  259.   internal state is consistent for following replace/replaceAll/...
  260.   commands.
  261. • replace - replace the current selection
  262. • replaceAll - replace all further occurrences in the current file or
  263.   set of files.
  264. • replace&FindAgain - replace the current selection and find next 
  265.   occurrence.
  266. • replaceString [<str>] - specifies replacement string. Returns current 
  267.   replacement string if no arg.
  268. • search  [options…] <pattern> <pos> - 
  269.   -f <num>        - go forward?
  270.   -r <num>        - regular expression?
  271.   -s            - save previous search string and search flags.
  272.   -i <num>        - ignore case?
  273.   -m <num>        - match words?
  274.   -n            - failed search still returns TCL_OK, but null string.
  275.   -l <limit>    - limit on how search goes.
  276.   --             - next arg is the pattern.
  277.  
  278.   Searches for 'pattern' from position 'pos'.  If the search succeeds, a 
  279.   list of two positions will be returned.  The first is the starting position 
  280.   of the match, the second is one past the last character. If no '-n', 
  281.   TCL_ERROR returned.  See also performSearch
  282. • searchString [<str>] - allows search string to be specified. Returns 
  283.   current searchstring if no arg.
  284. • isearch - incremental search: searches w/o a dialog,
  285.   searches as you type the search pattern. Does not do
  286.   regular expression searches. 'matchWords' 
  287.   automatically set to false.
  288. • rsearch - reverse incremental search, see 'isearch'.
  289.  
  290. Window manager (and window creation)
  291.  
  292. • bringToFront <winName> - Bring named window to front.
  293. • closeAll - close all windows
  294. • edit [-r] [-m] [-c] [-w] [-g <l> <t> <w> <h>] <name> - Open a file in new 
  295.   window. '-c' means don't prompt for duplicate win if file already open.
  296.   '-r' means open the file read-only. '-m' means omit the function titlebar 
  297.   menu and present only the marks titlebar menu, which is labeled with the 
  298.   contents of 'markLabel'. The '-g' option allows left and top coords to 
  299.   be specified, plus width, and height. All or none. '-w' allows you to
  300.   bypass the "Wrap" dialog for files with long rows.
  301. • float -m <menu> [<-h|-w|-l|-t|-M> <val>] [-n winname] [-z tag] -
  302.   Takes a created menu (not necessarily in the menubar), and makes a 
  303.   floating window out of it. Returns integer tag that is used to remove 
  304.   the window. NOT DYNAMIC!  W/ no options returns all currently defined menus.
  305.   Displayed w/ system floating window WDEF if system 7.5, plainDBox 
  306.   otherwise. -h through -M change width, height, left margin, top margin, and
  307.   margin between buttons. -z allows a ten-char tag to be specified for 
  308.   'floatShowHide'.
  309. • floatShowHide <on|off> <tag> - Shows or hides all floats w/ specified 
  310.   tag. Tags of current modes are automatically shown/hidden.
  311. • getGeometry [win] - return a TCL list containing the left 
  312.   edge of the current window, the top, the width, and height.
  313. • getMainDevice - return a list containing the left, top, right, and 
  314.   bottom of the rectangle defining the main device.
  315. • icon [-f <winName>] [-c|-o|-t|-q] [-g <h> <v>] - Having to do w/ 
  316.   iconifying windows. '-c' means close (iconify) window, '-o' open, '-t' 
  317.   toggle open/close, '-q' returns either a '1' for an iconified window or a 
  318.   '0' for an uniconified window, and '-g' moves the icon to horizontal 
  319.   position <h> and vertical position 'v'. Options are executed as they 
  320.   are parsed, so the '-f' option, if present, should always be first. 
  321. • killWindow - kill current window
  322. • mousePos - Returns list <row,col> of mouse position, if the mouse is 
  323.   currently over the active window. Otherwise, return error (catch w/ 
  324.   'catch').
  325. • moveWin [win name] <left> <top> - moves current or specified window. 
  326.   The window name can be "StatusWin".
  327. • new [-g <l> <t> <w> <h>] [-n <name>] - opens an untitled window. Can optionally 
  328.   provide left and top coordinates, plus width and height. All or none.
  329. • nextWindow - select next window
  330. • otherPane - If window is split, select the other pane.
  331. • prevWindow - select previous window
  332. • sizeWin [win name] <width> <height> - sets size of current or specified window.
  333.   The window name can be "StatusWin", although only the width can be 
  334.   changed.
  335. • splitWindow [percent] - toggle having window split into two panes. 
  336.   Optional arg specifies percent of window to allocate to the first pane. 
  337. • winNames [-f] - return a TCL list of all open windows. If '-f' option 
  338.   specified, complete pathnames are returned.
  339. • zoom - zooms the current window
  340.  
  341. Menu creation/manipulation
  342.  
  343. • addMenuItem [-m] [-l <meta-characters>] <menu name> <item name> - Convert
  344.   item to menu form and add to specified menu. If '-m' specified, menu 
  345.   form conversion not done. The '-l' option allows you to use menu meta 
  346.   characters as text of menu items. If the '-l' option is used, the 
  347.   <meta-characters> string is interpreted for menu item attributes, and 
  348.   meta-characters in <item name> are included in the menu item text 
  349.   literally. For example: 
  350.       addMenuItem -m -l "/B" "Hello/C" 
  351.   would appear as the text "Hello/C" in the menu, and have "B" as its 
  352.   command equivalent.
  353. • deleteMenuItem [-m] <menu name> <item name> - Convert item to menu form 
  354.   and delete from specified menu. If '-m' specified, menu form conversion 
  355.   not done. 
  356. • enableMenuItem [-m] <menuName> <item text> <on|off> - Either enable or 
  357.   disable the menu item of user menu 'menuName' that has text '<item 
  358.   text>'. Note that unless the menu is not only created, but also already
  359.   inserted, this command has no effect. 
  360. • insertMenu <name> - insert the previously created user menu 'name' into 
  361.   the menuBar. 
  362. • markMenuItem [-m] <menuName> <item text> <on|off> [<mark char>] - Either mark or unmark
  363.   the menu item of user menu 'menuName' that has text '<item text>'. 
  364.   Note that unless the menu is not only created, but also already
  365.   inserted, this command has no effect. 
  366. • Menu [-s] [-n <name>] [-i <num] [-m] [-M <mode>] [-p <procname>] <list of menu items> - 
  367.   Defines a new menu named 'name' (if provided w/ '-n' option). The menu is not 
  368.   yet inserted into the menubar. The menu commands may be nested for 
  369.   heirarchical menus, see 'AlphaBits.tcl' for examples. Alpha massages the 
  370.   function names to make them look better in the menus. 
  371.   '-c'            Ignore any menu meta-chars. Can also be done on a per-item basis 
  372.                   by appending an ampersand ('&') to the end of an item.
  373.   '-s'            Use system menu definition proc (faster).
  374.   '-n <num>'    Resource id of icon suite to use for menu title. 'ics#' 
  375.                 is the only resource that is really necessary.
  376.   '-n <name>'    Name the menu. Not necessary for submenus.
  377.   '-m'            No menu form. If not supplied, each menu item is split into 
  378.                   words at each capitalized letter.
  379.   '-p <name>'     The tcl proc named by 'name' is called w/ the menu's name
  380.                   and the item's contents when the item is chosen.
  381.   '-M <mode>'    Specifies that any bindings created by the menu are 
  382.                   specific to a given mode. This is important because mode-specific
  383.                   bindings over-ride global bindings.
  384. • removeMenu <name> - remove menu 'name' from menubar, except those 
  385.   specified by previous 'makeMenuPermanent' calls.
  386.  
  387. Inter-application communication
  388.  
  389. • AEBuild [<flags>] <app (name|creator)> <aesuite> <aeevent> [<event parameters>]*  -
  390.   Build and send an apple-event. 'AEBuild' is apple's code of the same 
  391.   name. Each "event parameter" is two parameters, a parameter type and 
  392.   the data for the parameter. See the AEBuild doc for more details, 
  393.   :Tcl:SystemCode:think.tcl for examples. The flags are '-r' (wait for reply), 
  394.   '-q' (queue reply, in which case 'handleReply' (in appleEvents.tcl) is 
  395.   called with the reply as a parameter, and '-t <timeout>' specifies the 
  396.   timeout in ticks.
  397. • dosc [<-c 'sign' | -n appName>] [-k 'clas'] [-e 'evnt'] <-s string | -f fileName> [<-t timeout|-r>]
  398.   Send an AppleEvent, by default class 'misc', event 'dosc'.
  399.    -c 'sign' 
  400.            "sign" is a four-letter creator signature of a running application.
  401.    -n appName
  402.            "appName" is the name of a running application.
  403.    -k 'clas'
  404.            "clas" is a four-letter event class.
  405.    -e 'evnt'
  406.            "evnt" is a four-letter event class.
  407.    -s string
  408.            "string" is the text of a script to send to the other app.
  409.    -f fileName
  410.            "fileName" is the complete or relative pathname of a file the other 
  411.            application should execute.
  412.    -t timeout
  413.            "timeout" is the number of ticks Alpha should wait for a response. A 
  414.            timeout of "0" means wait forever.
  415.    -r
  416.            Do not wait for reply.
  417.    -q
  418.            Queue reply.
  419.            
  420.    If neither of the '-c' and '-n' options is chosen, the PPC Browser is 
  421.    used. Either '-s' or '-f' must be chosen. Thus, you can have "Alpha 
  422.    5.02" and "Alpha 5.02 Copy" sending Apple events to each other, or they 
  423.    can send events to a remote server such as Apple's ToolServer. 
  424.    "$HOME:Tcl:UserCode:createStuffitArchive.tcl" contains examples of 
  425.    controlling Stuffit Deluxe via this command.
  426. • eventHandler [class] [event] [proc] - Register 'proc' to handle the class 
  427.   and event specified. Class and event are each 4 char args. 'proc' takes 
  428.   a single argument that specifies the incoming event according to the 
  429.   syntax here. There is currently no provision for a reply.
  430. • icURL <URL> - passes arg to Internet Config, if present. Error if not 
  431.   present.  You should use 'url::execute' instead (icURL is
  432.   deprecated).
  433. • icGetPref [<-t <type>] <pref name> - Gets preference from 
  434.   Internet Config. '-t' allows type to be set, '0' returns a string 
  435.   (default), '1' returns a path name, commonly used for helper apps. A 
  436.   <pref name> of 'all' returns all valid preferences.
  437. • icOpen - Opens Internet Config
  438. • launch -f <name> - launch the named app into the background. Note that 
  439.   for some yet unexplained reason, some applications (MicroSoft Word) 
  440.   won't launch completely in the background. 'launch'ing such 
  441.   applications won't insert the application into any system menu that 
  442.   specifies running applications (although "About the Finder..." will 
  443.   list it. The only way to get to such an app is through Alpha's 
  444.   'switchTo', after which the application will finish launching. The '-f' 
  445.   option gets around this by launching the application in the foreground 
  446.   instead.
  447. • nameFromAppl '<app sig>' - Interrogates the desktop database for the first 
  448.   existing app that has the desired signature. <app sig> is four chars 
  449.   inside single quotes.
  450. • processes - returns info of active processes. A list of lists, each 
  451.   sublist contain a file-name, an application signature, the application 
  452.   memory size, and the number of ticks the application has been active.
  453. • switchTo <appName> - Switches to application 'appName'.
  454. • sendOpenEvent [filler] <app name> <file name> - Send an open doc event to 
  455.   another currently running application. If 'filler' is noReply, then a 
  456.   reply is not requested. Otherwise, we wait for a reply and 'filler' is 
  457.   ignored. 
  458. • specToPathName [hex data] - given an FSSpec in hex form (as that 
  459.   returned by aebuild, for instance, see the definition of thinkFileName 
  460.   in :Tcl:SystemCode:think.tcl), return a complete pathname.
  461.  
  462. Keyboard bindings and codes
  463.  
  464. • ascii (see bindings).
  465. • Bind  (see bindings)
  466. • deleteModeBindings <mode> - Delete all bindings for specified mode.
  467. • describeBinding - display the binding of the next typed key sequence. 
  468. • getAscii - displays the ASCII code for character at 
  469.   current insertion point
  470. • getChar - waits for a keystroke, returns ascii.
  471. • getModifiers - returns current modifiers mask. "OR" of several values, 
  472.     cmdKey                        = 0x01,                        /* Bit 0 of high byte */
  473.     shiftKey                    = 0x02,                        /* Bit 1 of high byte */
  474.     alphaLock                    = 0x04,                        /* Bit 2 of high byte */
  475.     optionKey                    = 0x08,                        /* Bit 3 of high byte */
  476.     controlKey                    = 0x10,                        /* Bit 4 of high byte */
  477.     rightShiftKey                = 0x20,                        /* Bit 5 of high byte */
  478.     rightOptionKey                = 0x40,                        /* Bit 6 of high byte */
  479.     rightControlKey                = 0x80,                        /* Bit 7 of high byte */
  480. • keyAscii - insert ascii representation (in decimal)
  481.   of the keydown event, plus a modifier string, if 
  482.   necessary.
  483. • keyCode - insert the key code along w/ a string 
  484.   representing and modifiers into the current window.
  485.   Can be used to create bindings in 'Alphabits'.
  486. • prefixChar - used to further modify the next keystroke 
  487.   combination, in the same manner as using the shift key 
  488.   in the next keystroke
  489. • startEscape - used to further modify the next 
  490.   keystroke combination, in the same manner as using the 
  491.   shift key in the next keystroke
  492. • unascii  (see bindings)
  493. • unbind  (see bindings)
  494.  
  495. Status window
  496.  
  497. • execute - prompt user for a function or macro. The 
  498.   tab key acts as a "completion" command.
  499. • message <string> - prints 'string' on the status line.
  500. • statusPrompt <prompt> [<func>] - Prompt in the status window. If 'func' 
  501.   is present, call this routine at each key-press with the current 
  502.   contents of the status line and the key, insert into statusline 
  503.   whatever is returned by the func. Command-v pastes the current (<80 
  504.   char) clipboard contents on the status line.
  505.  
  506. Filesystem
  507.  
  508. • getFileInfo <file> <arr> - Given a file name, creates an array called 
  509.   'arr' in the current context, containing fields 'created', 'creator', 
  510.   'modified', 'type', 'datalen', and 'resourcelen'. 'created' and 
  511.   'modified' are in a form suitable for the command 'mtime'.
  512. • glob [-i] [-t <TYPE>] [-c <CRTR>]
  513.   The original glob provided by the UNIX version of tcl was not quite 
  514.   adequate for the more complex Macintosh file system. Issues such as 
  515.   invisible file handling, Finder type and creator filtering, and space 
  516.   handling in file names. Release 6 of tcl has dealt with the original 
  517.   problem with spaces in filenames, but the following options are provided 
  518.   to deal with additional Macintosh issues. 
  519.  
  520. Anyway, the new glob now takes several options. They are:
  521.     -i    This option causes glob to list invisible files also.
  522.     -t TYPE    This option causes glob to only list file with the 
  523.         indicated Finder file typeTYPE. This option may be 
  524.         used with the -c option.
  525.     -c CRTR    This option causes glob to only list file with the 
  526.         indicated Finder file creatorCRTR. This option may 
  527.         be used with the -t option.
  528.         Also note that the original glob would skip dot files
  529.         (i.e., file names the begin with a period) 
  530.         in the listing, unless the pattern began with a period.
  531.         Tickle extends this concept one step further on the
  532.         Macintosh, and skips spot files (i.e., file names that 
  533.         begin with '•'), unless the pattern starts with a spot.
  534. • pwd
  535.   This command will return the current working directory, ending in a colon.
  536. • setFileInfo <file> <field> [arg] - Allows some information to be set 
  537.   for files. Settable fields are 'modified', 'created', 'creator', and 'type'.
  538.   All take an argument except 'resourcelen' which just removes the resource fork. 'file' is a complete pathname.
  539. • wc <file>... - counts chars, words, lines of input files.
  540.  
  541. Debugging
  542.  
  543. • echo <string>* - echo the strings (used 
  544.   in shells).
  545. • evaluate - evaluates hilited text, or entire window if 
  546.   nothing is hilited. 'evaluat'ing means that whatever 
  547.   bindings or macro definitions are present in the 
  548.   evaluated text take effect
  549. • shell - open the Tcl shell.
  550. • traceFunc on <funcName> <winName> Trace 'funcName', send output to 
  551.                                     'winName'. 
  552.   traceFunc off                        Turn function tracing off.
  553.   traceFunc status                    Display current tracing status.
  554.  
  555. Colours
  556.  
  557. • dumpColors - dump current foreground and background
  558.   colors into the current buffer in Alpha-readable
  559.   format.
  560. • getColors - returns list of colors/hypertext for current document. 
  561.   Format is list of lists, each sublist consisting of file offset, color 
  562.   index, and possibly a hypertext command.
  563. • insertColorEscape <pos> <color ind> [hypertext func] - Create a color 
  564.   or style "point" for documentation purposes. Look at the file 
  565.   "colorsMenu.tcl" for examples. The hypertext func is only used when the 
  566.   "point" is underline. See 'getColors' for info about the current file.
  567.   You should now use text::color and text::hyper instead of this
  568.   function.
  569. • regModeKeywords [options] <mode> <keyword list> - Set keywords and comments that 
  570.   Alpha can recognize to color them. Specifically, in mode <mode>, every 
  571.   keyword specified in the list is colored non-black (blue, by default). 
  572.   Comments, if specified by '-e' or '-b' below, are colored red by defualt.
  573.     -a                                Keywords will be *added* to existing mode
  574.                                     keywords. The new keywords can be a different
  575.                                     color than older keywords. This flag can also be
  576.                                     used to modify other attributes, but it cannot be
  577.                                     used to modify colors of existing keywords.
  578.     -m <c>                            Specify a magic character. Every word beginning with the 
  579.                                     magic character is a keyword.
  580.     -e <commentstr>                    Specify a string that begins comments that last to 
  581.                                     the end of the line. 
  582.     -b <comment beg> <comment end>    Specify a pair of strings that bracket a 
  583.                                     comment.
  584.     -c <color>                        Comment color.
  585.     -k <color>                        Keyword color.
  586.     -s <color>                        String color. Alpha can color single-line
  587.                                     strings only, using the simple heuristic
  588.                                     of assuming the first two double quotes
  589.                                     constitute a string. 
  590.     -i <char>                        Specify a character to display differently.
  591.                                     Commonly used for curly braces, etc.
  592.     -I <color>                        Color of above characters.
  593.     Keywords must be less than 20 characters long.
  594.  
  595. Keyboard macros
  596.  
  597. • endKeyboardMacro - stop recording keyboard macro
  598. • executeKeyboardMacro - execute the current keyboard 
  599.   macro
  600. • iterationCount - allows actions to be repeated many times. "control-u 44 
  601.   =" inserts 44 '='s into current window.  Also can be used to execute any 
  602.   function or macro (including the keyboard macro) many times.  Defaults to 
  603.   4.
  604. • startKeyboardMacro - start recording keyboard macro
  605.  
  606. Time related
  607.  
  608. • mtime <time> [long|short|abbrev]
  609.   Returns a date and time string using the Macintosh International Utilities. The 
  610.   long/short/abbrev specification corresponds to the date. These are the following 
  611.   formats:
  612.     short        3/16/92 9:20:46 PM
  613.     abbrev    Mon, Mar 16, 1992 9:20:49 PM
  614.     long        Monday, March 16, 1992 9:20:43 PM
  615.   The returned value actually is in the form of a list. To get text as 
  616.   above, run the result through 'join', as in "join [mtime [now] short]".
  617. • now
  618.   Returns the current time as Macintosh seconds. This is the number of seconds that 
  619.   have elapsed since Midnight Jan 1, 1904.
  620. • ticks
  621.   Returns the current TickCount. Ticks are 60ths of a seconds. TickCount is the 
  622.   number of ticks since the Macintosh was started. The command:
  623.         puts stdout [expr "[ticks] / 60"]
  624.   will print the number of seconds since the Macintosh was booted.
  625.  
  626. Marks
  627.  
  628. • createTMark <name> <pos> - create a temporary 'mark' 
  629.   at location 'pos'. 
  630. • getMark - return the current mark.
  631. • getNamedMarks [-w <win>] [-n] - 
  632.   return list of all permanent marks in open files. Each
  633.   element of a list describes one mark as a sublist of the mark's name, 
  634.   the complete pathname of the mark's file, the position of the first 
  635.   character in the first line displayed, the current position, and the 
  636.   end of the selection if text is hilited, or the current position again 
  637.   if there is no hilited section. '-w' allows window name to be applied 
  638.   as filter, '-n' means only names will be returned.
  639. • getTMarks - Return a list of temporary marks. Each item of the returned 
  640.   list is a sublist containing the mark name, the complete pathname of the 
  641.   mark, and the start and finish of the selection named by the mark. The 
  642.   following is an example of the result: 
  643.  
  644.     {{temp1 External:file.c 1312 1315} {temp2 Internal:it.h 111 111}} 
  645. • removeTMark <name> - remove temporary mark.
  646. • setNamedMark [name disp pos end] - set named mark. If optional arguments are 
  647.   present, the mark is created without prompting user. 'disp' is the 
  648.   character position of the start of the first line to be displayed, 
  649.   while 'pos' and 'end' bracket the text to be selected.
  650.  
  651.  
  652. Remaining commands (in alphabetical order) -- some of these still need
  653. placing in other sections of this document.
  654.  
  655. • abortEm - aborts whatever is currently happening
  656. • addAlphaChars <chars> - Add <chars> to the list of characters that internally 
  657.   are caught by the 'isalnum' and 'isalpha' calls. Can be used to augment 
  658.   the list of characters that the \w pattern in a regular expression 
  659.   responds to. Use w/ care.
  660. • beep [-volume num] [-list | sndName]?
  661.   where -volume and -list are switches, while num and sndName are variables.
  662.   Ex:  beep -volume 3 "click in set 5"  play at volume 3 the sound named
  663.   "click in set 5" in the Alpha's snd resource.
  664.   Any sound stored in that resource can be used as well, so feel free to
  665.   paste a sound (with ResEdit) in the snd resource to have it available.
  666. • blink <pos> - blink cursor at 'pos'
  667. • breakIntoLines <string> - return 'string' with 
  668.   carriage returns and spaces inserted to satisfy 
  669.   'leftFillColumn' and 'fillColumn' variables.
  670. • createTagFile - searches all files in current file set 
  671.   and saves the locations of any function declarations
  672.   in a file called 'cTAGS'.
  673. • displayMode <mode> - Up to four characters of the 'mode' string are 
  674.   displayed in the status line at the bottom of a window.
  675. • findTag - prompt user for a function name and attempt 
  676.   to use the file 'cTAGS' to locate the function's 
  677.   definition
  678. • getWinInfo [-w <win>] <arr> - Creates an array in current context 
  679.   containing info about either the current or a specified window. Array 
  680.   has fields 'state', 'platform', 'read-only', 'tabsize', 'split', 
  681.   'linesdisp' (num lines that can be seen in the window), 'currline' 
  682.   (first line displayed), and 'dirty'.
  683. • insertAscii - prompts for an ASCII code and inserts
  684.   into text.
  685. • pageSetup - display the printing PageSetup dialog.
  686. • print - print front window
  687. • quit - quits ALPHA
  688. • redo - redo the next action that has been undone but 
  689.   not redone
  690. • revert ?-w win? - revert the file to its last saved version
  691. • save - save current window
  692. • saveAs ?-f? [def name] - save current window with new name. Optionally 
  693.   takes a default filename. Returns complete path of saved file, if ok hit, 
  694.   otherwise TCL_ERROR returned. If '-f' flag given, then we force the save
  695.   without any standard-file dialog.
  696. • setWinInfo [-w <win>] <field> <arg> - Sets a piece of data about either 
  697.   the current or a specified window. Settable fields 'platform', 'state', 
  698.   'read-only', 'tabsize', 'dirty', and 'shell'. 'shell' means that dirty 
  699.   flag ignored and undo off.
  700. • tab - insert a tab
  701. • toggleScrollbar - toggles horizontal scrollbar on frontmost window. 
  702.   Will not succeed if scrollbar scrolled.
  703. • undo - undo the last action that has not been undone
  704. • unfloat <float num> - removes specified floating window. W/ no options 
  705.   lists all floating windows.
  706. • version - Return string of the form "Alpha Version 5.31, Feb. 15, 1993".
  707. • watchCursor - turns the cursor into a a watch cursor.
  708. • yank - insert the last piece of deleted text of less
  709.   than 1k. Consecutive deletes are concatenated.
  710.   together.
  711. • zapInvisibles - removes chars < ascii 32, except for
  712.   LF's and CR's.
  713.  
  714.   Obsolete (and possibly buggy).  These WILL be removed in Alpha 8.
  715.  
  716. • cp <fromName>+ <toName>
  717.   This command will copy the file fromName and name the new file toName, 
  718.   overwriting any existing file. This command copies both data forks, and 
  719.   the Finder information.  'file copy' is the prefered means of carrying
  720.   out copies in Alpha 7.0 or newer.
  721. • mkdir <name> - creates a directory (folder) named 
  722.   'name' in the current directory.  Use 'file mkdir' instead.
  723. • moveFile <fromName> <toName>
  724.   This command will move the file fromName to toName, overwriting any 
  725.   existing file. The move can not be made across volume (disk drives) 
  726.   boundaries.  Use 'file copy/delete' instead.
  727. • removeFile <fileName>
  728.   This command will delete the file or folder 'fileName'.  Use 'file
  729.   delete' instead.
  730. • rmdir <dirname> - remove a directory (folder).  'file delete <dirname>' is 
  731.   the prefered means of deleting directories in Alpha 7.0 or newer.
  732. • xtclcmd [-f filename] <cmdname> [argument_list]*
  733.   This command will load the external command cmdname and pass it the argument 
  734.   list [ cmdname argument_list... ]. External command are code resources of type 
  735.   XTCL. They may be located in the resource fork of the tickle application, or they 
  736.   may be located in a file named XTCL File in the same directory as the tickle 
  737.   application. If the optional -f filename is included, the external command will first 
  738.   be loaded from filename before the other two files.
  739.   See the appendix for a detailed description of the external tcl command interface. 
  740.   See the accompanying sources for an example of writing an XTCL.
  741.  
  742. Uncommon/unused commands probably best to avoid using these.
  743.  
  744. • abbrev <label> <string> [<mode>] - register a label for <string>. See 
  745. 'execAbbrev'.
  746. • currentPosition - displays current and total bytes.
  747. • execAbbrev - looks at current word and tries to expand it. Labels are 
  748.   specified using 'abbrev'.
  749. • fileInfo - prompts for a file, and displays type, 
  750.   creator, sizes of both data and resource forks, last
  751.   modification time, and creation time
  752. • fileRemove - prompts for a file, and removes it
  753. • freeMem - give a rough approximation of the current 
  754.   memory reserves of ALPHA
  755. • getPathName - prompt the user with an SFGetFile dialog and return 
  756.   complete pathname.
  757. • insertFile - prompts for a file name and inserts the
  758.   corresponding file into the current window. Not
  759.   undoable.
  760. • insertPathName - present the user w/ a SFGetFIle dialog 
  761.   and paste the complete path-name of the chosen file
  762.   into the current window
  763. • largestPrefix <list> - Returns the longest prefix contained in all 
  764.   strings of 'list'.
  765. • substituteVars <string> - Takes a single string and
  766.   substitutes for all variables inside it, regardless of
  767.   depth. Unfortunately, you currently need to make 'global var' 
  768.   declarations in the proc you call this for each 'var' that might need 
  769.   to be substituted in the string (see proc.tcl for examples).
  770.